<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!--dashboard calendar-->
<link href="${ctxPath }/static/css/clndr.css" rel="stylesheet">
<!--Morris Chart CSS -->
<link rel="stylesheet"
	href="${ctxPath }/static/js/morris-chart/morris.css">
<!--common-->
<link href="${ctxPath }/static/css/style.css" rel="stylesheet">
<link href="${ctxPath }/static/css/style-responsive.css"
	rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon"
	href="static/images/lukebang320.ico" media="screen" />
<link rel="icon" href="static/images/lukebang320.ico"
	type="image/x-icon" />
<link rel="bookmark" href="static/images/lukebang320.ico"
	type="image/x-icon" />
<link href="${ctxPath}/static/css/bootstrap.min.css" rel="stylesheet" />
<link
	href="${ctxPath }/static/js/bootstrap-touchspin/bootstrap.touchspin.min.css"
	rel="stylesheet" type="text/css" />
<link href="${ctxPath}/static/js/useful-toastr/toastr.min.css"
	rel="stylesheet" />
<title>鹿客帮</title>
<section>
	<!-- 右上角 -->
	<div class="header-section">
		<a class="toggle-btn"><i class="fa fa-bars"></i></a>
		<div class="menu-right">
			<ul class="notification-menu">
				<li><a href="#" class="btn btn-default dropdown-toggle"
					data-toggle="dropdown"> <img id="merchant_avatar" src="" alt="" />
						${sessionScope.sessionUser.name} <span class="caret"></span>
				</a>
					<ul class="dropdown-menu dropdown-menu-usermenu pull-right">
						<!-- <li><a href="#"><i class="fa fa-user"></i>个人信息</a></li> -->
						<li><a href="javascript:logout()"><i
								class="fa fa-sign-out"></i>注销</a></li>
					</ul></li>
			</ul>
		</div>
		<!--notification menu end -->
	</div>
	<!-- 右上角结束 -->
	<div class="left-side sticky-left-side">
		<!--图标-->
		<div class="logo">
			<a href="login/toIndex.do"><img alt=""></a>
		</div>
		<div class="logo-icon text-center">
			<a href="login/toIndex.do"><img alt=""></a>
		</div>
		<div class="left-side-inner">
			<!--左侧菜单栏-->
			<ul class="nav nav-pills nav-stacked custom-nav">
				<li id="welcome" class=""><a href="${ctxPath }/index.html"><i
						class="fa fa-home"></i><span>欢迎页</span></a></li>
				<li id="areaSearch" class=""><a href="${ctxPath}/territory/areaSearch"><i
						class="fa fa-book"></i><span>区域查询</span></a></li>
				<li class="menu-list" id="newTask"><a href=""> <i
						class="fa fa-book"></i> <span>新建订单</span></a>
					<ul class="sub-menu-list" style="display: none;">
						<li id="measure"><a href="${ctxPath }/indent/addMeasure.htm">新建测量单</a></li>
						<li id="install"><a href="${ctxPath }/indent/addInstall.htm">新建安装单</a></li>
						<li id="repair"><a href="${ctxPath }/indent/addRepair.htm">新建维修单</a></li>
					</ul></li>
				<li class="menu-list" id="taskList"><a href=""><i
						class="fa fa-book"></i> <span>我的订单</span></a>
					<ul class="sub-menu-list" style="display: none;">
						<li id="measureList"><a
							href="${ctxPath }/indent/measureList/pay.htm">测量订单</a></li>
						<li id="installList"><a
							href="${ctxPath }/indent/installList/pay.htm">安装订单</a></li>
						<li id="repairList"><a
							href="${ctxPath }/indent/repairList/pay.htm">维修订单</a></li>
					</ul></li>
				<li class="menu-list" id="wallet"><a href="#"> <i
						class="fa fa-jpy"></i> <span style="color: yellow" id="toMoney"></span></a>
					<ul class="sub-menu-list sub-menu-list2" style="display: none;">
						<li id="rechargeModalLabel"><a href="#"
							onclick="javascript:$('#rechargeModal').modal('show');">充值</a></li>
						<li id="withDrawalMoney"><a
							href="${ctxPath}/merchant/withDrawalMoney">提现</a></li>
						<li id="merchantRecord"><a
							href="${ctxPath}/merchant/merchantRecord">明细</a></li>
					</ul></li>
			</ul>
			<!--sidebar nav end-->
		</div>
	</div>
</section>
<jsp:include page="../wallet/rechargeModal.jsp"></jsp:include>
<%-- <jsp:include page="details.jsp"></jsp:include> --%>
<script src="${ctxPath}/static/js/jquery-1.10.2.min.js"></script>
<script src="${ctxPath}/static/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="${ctxPath}/static/js/jquery-migrate-1.2.1.min.js"></script>
<script src="${ctxPath}/static/js/bootstrap.min.js"></script>
<script src="${ctxPath}/static/js/modernizr.min.js"></script>
<script src="${ctxPath}/static/js/jquery.nicescroll.js"></script>
<script src="${ctxPath}/static/js/scripts.js"></script>
<script src="${ctxPath}/static/js/html5shiv.js"></script>
<script src="${ctxPath}/static/js/respond.min.js"></script>
<script
	src="${ctxPath }/static/js/bootstrap-touchspin/bootstrap.touchspin.min.js"
	type="text/javascript"></script>
<script>
	function indexmenu(oneMenu, twoMenu) {
		$("#" + twoMenu).attr("class", "active");
		var sub = $("#" + oneMenu).find('>ul'); //原来是查ul
		visibleSubMenuClose();
		$("#" + oneMenu).addClass('nav-active');
		sub.slideDown(0, function() {
			mainContentHeightAdjust();
		});
	}
	function rechargeAction() {
		Ewin.confirm({
			message : "是否确定充值？"
		}).on(function(e) {
			if (!e) {
				return;
			} else {
				$("#rechargeModalForm").submit();
			}
		});
	}
	function mainContentHeightAdjust() {
		var docHeight = jQuery(document).height();
		if (docHeight > jQuery('.main-content').height())
			jQuery('.main-content').height(docHeight);
	}
	function visibleSubMenuClose() {
		jQuery('.menu-list').each(function() {
			var t = jQuery(this);
			if (t.hasClass('nav-active')) {
				t.find('> ul').slideUp(200, function() {
					t.removeClass('nav-active');
				});
			}
		});
	}
	$(document).ready(

			function() {
				toastr.options = {
					"closeButton" : false,
					"debug" : false,
					"positionClass" : "toast-top-center",
					"showDuration" : "300",
					"hideDuration" : "1000",
					"timeOut" : "5000",
					"extendedTimeOut" : "1000",
					"showEasing" : "swing",
					"hideEasing" : "linear",
					"showMethod" : "fadeIn",
					"hideMethod" : "fadeOut"
				};
				$.post("${ctxPath }/merchant/getInitialInfomation", function(
						data) {
					$("#wallet").find("span").first().html(
							"余额：" + data.wallet.toFixed(2) + "元");
					if (data.avatar != null && data.avatar.length != 0) {
						$("#merchant_avatar").attr(
								'src',
								'http://okwc9gyzs.bkt.clouddn.com/'
										+ data.avatar
										+ "?imageView2/1/w/800/h/600");
					} else {
						$("#merchant_avatar").attr('src',
								'${ctxPath }/static/images/login-logo3.jpg');
					}
				})

				//点击 充值 变色
				$(".sub-menu-list2 li").click(
						function() {
							$(this).addClass("active").siblings().removeClass(
									"active");
						})
			});
	function logout() {
		Ewin.confirm({
			message : "确认要退出登录吗！"
		}).on(function(e) {
			if (!e) {
				return;
			} else {
				window.location.href = '${ctxPath }/merchant/logout.htm';
			}
		});
	}

	//充值，明细，提现 
	function reaction(object) {
		var opt = $("#walletOpt").val();
		if (opt == 0) {
			$("#rechargeModal").modal('show');
		} else if (opt == 1) {
			window.location.href = "${ctxPath}/merchant/withDrawalMoney";
		} else if (opt == 2) {
			window.location.href = "${ctxPath}/merchant/merchantRecord";
		}
	}
</script>
<script src="${ctxPath}/static/js/useful-toastr/toastr.min.js"></script>
<script src="${ctxPath}/static/js/useful-ewin/Ewin.js"></script>


